home *** CD-ROM | disk | FTP | other *** search
- unit Nodeinfo;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
- StdCtrls, ExtCtrls, ITGraph, SysUtils, ITGDefs;
-
- type
- TNodeInfoDlg = class(TForm)
- AcceptBtn: TBitBtn;
- CancelBtn: TBitBtn;
- Bevel1: TBevel;
- Label1: TLabel;
- Memo1: TMemo;
- Label2: TLabel;
- Label3: TLabel;
- ItemId: TEdit;
- ItemData: TEdit;
- Label4: TLabel;
- ItemXpos: TEdit;
- Label5: TLabel;
- ItemYpos: TEdit;
- Label6: TLabel;
- ItemWidth: TEdit;
- Label7: TLabel;
- ItemHeight: TEdit;
- ListSources: TListBox;
- LabelSources: TLabel;
- ListTargets: TListBox;
- LabelTargets: TLabel;
- procedure FormShow(Sender: TObject);
- procedure AcceptBtnClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- itgTheGraph : ^TITGraph;
- end;
-
- var
- NodeInfoDlg: TNodeInfoDlg;
-
- implementation
-
- {$R *.DFM}
-
- procedure TNodeInfoDlg.FormShow(Sender: TObject);
- var
- itemIx : Integer;
- currentIx : Integer;
- begin
- itemIx := itgTheGraph^.SelectedIndex;
- NodeInfoDlg.Caption := Concat('Properties for Item ', IntToStr(itemIx + 1),
- ' of ', IntToStr(itgTheGraph^.ListCount));
- Memo1.Text := itgTheGraph^.List(.itemIx.);
- ItemId.Text := IntToStr(itgTheGraph^.ItemId(.itemIx.));
- ItemData.Text := IntToStr(itgTheGraph^.ItemData(.itemIx.));
- ItemXpos.Text := IntToStr(itgTheGraph^.ItemXpos(.itemIx.));
- ItemYpos.Text := IntToStr(itgTheGraph^.ItemYpos(.itemIx.));
- ItemWidth.Text := IntToStr(itgTheGraph^.ItemWidth(.itemIx.));
- ItemHeight.Text := IntToStr(itgTheGraph^.ItemHeight(.itemIx.));
-
- itgTheGraph^.QueryItem := itemIx;
- itgTheGraph^.QueryState := ITG_QueryGetSources;
- LabelSources.Caption := Concat('Sources: ',
- IntToStr(itgTheGraph^.QueryCount));
- ListSources.Clear;
- while itgTheGraph^.QueryState <> ITG_QueryNone do
- begin
- currentIx := itgTheGraph^.ConnectFromIndex;
- ListSources.Items.Add(itgTheGraph^.List(.currentIx.));
- itgTheGraph^.QueryState := ITG_QueryIterate
- end;
-
- itgTheGraph^.QueryItem := itemIx;
- itgTheGraph^.QueryState := ITG_QueryGetTargets;
- LabelTargets.Caption := Concat('Targets: ',
- IntToStr(itgTheGraph^.QueryCount));
- ListTargets.Clear;
- while itgTheGraph^.QueryState <> ITG_QueryNone do
- begin
- currentIx := itgTheGraph^.ConnectToIndex;
- ListTargets.Items.Add(itgTheGraph^.List(.currentIx.));
- itgTheGraph^.QueryState := ITG_QueryIterate
- end;
- end;
-
- procedure TNodeInfoDlg.AcceptBtnClick(Sender: TObject);
- var
- itemIx : Integer;
- begin
- itemIx := itgTheGraph^.SelectedIndex;
- itgTheGraph^.List(.itemIx.) := Memo1.Text;
- itgTheGraph^.ItemData(.itemIx.) := StrToInt(ItemData.Text);
- itgTheGraph^.ItemXpos(.itemIx.) := StrToInt(ItemXpos.Text);
- itgTheGraph^.ItemYpos(.itemIx.) := StrToInt(ItemYpos.Text);
- itgTheGraph^.ItemWidth(.itemIx.) := StrToInt(ItemWidth.Text);
- itgTheGraph^.ItemHeight(.itemIx.) := StrToInt(ItemHeight.Text);
- end;
-
- end.
-